<html>
<head><meta charset="utf-8"><title>LLVM Coverage Mapping (for pgo, code coverage, etc.) · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LLVM.20Coverage.20Mapping.20(for.20pgo.2C.20code.20coverage.2C.20etc.2E).html">LLVM Coverage Mapping (for pgo, code coverage, etc.)</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="155306825"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LLVM%20Coverage%20Mapping%20%28for%20pgo%2C%20code%20coverage%2C%20etc.%29/near/155306825" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LLVM.20Coverage.20Mapping.20(for.20pgo.2C.20code.20coverage.2C.20etc.2E).html#155306825">(Jan 17 2019 at 02:50)</a>:</h4>
<p>Has anyone taken a look at adding LLVM Code Coverage Mapping to Rust? I'm looking into it so that we can start getting PGO and code coverage "the right way" for Fuchsia, and was reading <a href="https://llvm.org/docs/CoverageMappingFormat.html" target="_blank" title="https://llvm.org/docs/CoverageMappingFormat.html">https://llvm.org/docs/CoverageMappingFormat.html</a> and <a href="https://github.com/llvm/llvm-project/blob/master/clang/lib/CodeGen/CoverageMappingGen.cpp" target="_blank" title="https://github.com/llvm/llvm-project/blob/master/clang/lib/CodeGen/CoverageMappingGen.cpp">https://github.com/llvm/llvm-project/blob/master/clang/lib/CodeGen/CoverageMappingGen.cpp</a>. It doesn't look too terrible, but I wanted to give a heads-up here that this was something I was investigating in case anyone else had looked into doing the same thing and had any advice.</p>



<a name="155324362"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LLVM%20Coverage%20Mapping%20%28for%20pgo%2C%20code%20coverage%2C%20etc.%29/near/155324362" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LLVM.20Coverage.20Mapping.20(for.20pgo.2C.20code.20coverage.2C.20etc.2E).html#155324362">(Jan 17 2019 at 10:24)</a>:</h4>
<p>Awesome! I know that people want to have PGO.<br>
Is this different from how Clang does PGO normally?</p>



<a name="155337262"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LLVM%20Coverage%20Mapping%20%28for%20pgo%2C%20code%20coverage%2C%20etc.%29/near/155337262" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LLVM.20Coverage.20Mapping.20(for.20pgo.2C.20code.20coverage.2C.20etc.2E).html#155337262">(Jan 17 2019 at 14:09)</a>:</h4>
<p>I want to be using ccov testing on rustc</p>



<a name="155337269"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LLVM%20Coverage%20Mapping%20%28for%20pgo%2C%20code%20coverage%2C%20etc.%29/near/155337269" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LLVM.20Coverage.20Mapping.20(for.20pgo.2C.20code.20coverage.2C.20etc.2E).html#155337269">(Jan 17 2019 at 14:09)</a>:</h4>
<p>I've not looked into it at all</p>



<a name="155352747"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LLVM%20Coverage%20Mapping%20%28for%20pgo%2C%20code%20coverage%2C%20etc.%29/near/155352747" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LLVM.20Coverage.20Mapping.20(for.20pgo.2C.20code.20coverage.2C.20etc.2E).html#155352747">(Jan 17 2019 at 17:25)</a>:</h4>
<p><span class="user-mention" data-user-id="124287">@mw</span> This is what you get when you use -fprofile-instr-generate / -fcoverage-mapping</p>



<a name="155352792"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/LLVM%20Coverage%20Mapping%20%28for%20pgo%2C%20code%20coverage%2C%20etc.%29/near/155352792" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Taylor Cramer <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/LLVM.20Coverage.20Mapping.20(for.20pgo.2C.20code.20coverage.2C.20etc.2E).html#155352792">(Jan 17 2019 at 17:26)</a>:</h4>
<p>and what <code>llvm-cov</code> works off of</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>